//
//  NetRequestModle.m
//
//
//  Created by gynjobs on 2017/8/15.
//  Copyright © 2017年 gynjobs. All rights reserved.
//

#import "NetRequestModle.h"
#import "ClientApi.h"
#import "EncryptAction.h"
@implementation NetRequestModle
+(void)getTheAppCheckStatusForStar:(void (^)(NSError *error))errorCallBack {
    [[ClientApi getInstance]checkAppCheckStatus:^(id  _Nullable responseObject, NSError * _Nullable error) {
        if (error!=nil) {
            if (errorCallBack) {
                errorCallBack(error);
            }
        }else{
            id data = [responseObject objectForKey:@"data"];
            if (data) {
                id  status = [data objectForKey:@"status"];
                if (status) {
                    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
                    NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"];
                    NSString *strKey = [NSString stringWithFormat:@"activeStatus_%@",app_Version];
                    [[NSUserDefaults standardUserDefaults] setObject:status forKey:strKey];  //1是审核通过，0审核中
                }
            }
            if(errorCallBack){
                
                errorCallBack(nil);
            }
            
        }
    }];
}
@end
